%% ========================================================================
%                           Main Caller
%%=========================================================================
% Calls main analysis, 'main_new.m', and sets log location and error
% behavior.
try
    project_root = erase(pwd, regexpPattern("/01Code.*"));
    log_location = [project_root, '/05Logs/Model_Matlab.log'];
    if exist(log_location, 'file') ; delete(log_location); end
    diary(log_location);
    run('setup.m');
    run('main_new.m');
catch e 
     fprintf(1,'The identifier was:\n%s',e.identifier);
     fprintf(1,'There was an error!\nERROR: %s',e.message);
end
diary off; 
exit;